{php $records1=tag("table=link&condition=status=3&order=listorder desc,itemid desc&template=null")}
{php $records2=tag("table=type&condition=item='link' and parentid=0&order=listorder,typeid&template=null");}
{if $records1 || $records2 && count($records2)>1}
<div class="main">
	<div class="container">
<div class="line01 item-top">
	<div class="boxtitle clearfix">
		{if $records2 && count($records2)>1}
		<div class="scroll0{$objectcount} menu">
			<table align="center">
				<tbody>
					<tr>
						{loop $records2 $k $r2}
						<td><font{if $k==0} class="active"{/if}>{strip_tags($r2[typename])}</font></td>
						{/loop}
					</tr>
				</tbody>
			</table>
		</div>
		{else}
		<span><i class="fa fa-link"></i> {if $records2}{strip_tags($records2[0][typename])}{else}友情链接{/if}</span>
		{/if}
	</div>
	{if $records2 && count($records2)>1}
		{loop $records2 $k $r2}
			{php $records1=tag("table=link&condition=status=3 and typeid=".$r2["typeid"]."&order=listorder desc,itemid desc&template=null")}
	<div class="scroll0{$objectcount}content clearfix{if $k>0} noactive{/if} item-top">
			{if $records1}
		<div class="owl-carousel carousel-autoplay8">
				{loop $records1 $r1}
			<div class="boxvalue"><div class="iteminfo"><div><a href="{$r1[linkurl]}" target="_blank" title="{strip_tags($r1[title])}"><img src="{if $r1[thumb]}{$r1[thumb]}{else}{DT_PATH}template/{$CFG[template]}/skin/images/linenopic.png{/if}" alt="{strip_tags($r1[title])}" align="left"></a><a class="texttitle" href="{$r1[linkurl]}" target="_blank" title="{strip_tags($r1[title])}">{strip_tags($r1[title])}</a></div></div></div>
				{/loop}
		</div>
			{/if}
	</div>
		{/loop}
<script language="javascript">
function scroll0{$objectcount}_start(){
	var scroll0{$objectcount}=new IScroll(".scroll0{$objectcount}",{scrollX:true,scrollY:false,freeScroll:true,mouseWheel:true,click:true});
}
$(document).ready(function (){
	setTimeout("scroll0{$objectcount}_start()",2000);
	$(".scroll0{$objectcount} font").click(function () {
		var id = $(".scroll0{$objectcount} font").index(this);
		$(".scroll0{$objectcount} font").removeClass("active").eq(id).addClass("active");
		$(".scroll0{$objectcount++}content").hide().eq(id).show();
	});
})
</script>
	{else}
	<div class="scroll01content item-top">
		{if $records1}
		<div class="owl-carousel carousel-autoplay8">
			{loop $records1 $r1}
			<div class="boxvalue"><div class="iteminfo"><div><a href="{$r1[linkurl]}" target="_blank" title="{strip_tags($r1[title])}"><img src="{if $r1[thumb]}{$r1[thumb]}{else}{DT_PATH}template/{$CFG[template]}/skin/images/linenopic.png{/if}" alt="{strip_tags($r1[title])}" align="left"></a><a class="texttitle" href="{$r1[linkurl]}" target="_blank" title="{strip_tags($r1[title])}">{strip_tags($r1[title])}</a></div></div></div>
			{/loop}
		</div>
		{/if}
	</div>
	{/if}
</div>
	</div>
</div>
{/if}